#include <stdio.h>
#include <unistd.h>

#include "server.h"

int init_server(const char *conf_path, char *ip, char *port, int *thread_num,
                char *root_path) {
  FILE *fp = fopen(conf_path, "r");
  fscanf(fp, "%s %s %d %s", ip, port, thread_num, root_path);
  int ret = chdir(root_path);
  if (ret == -1) {
    perror("chdir");
  }
  return ret;
}
